package br.ufrn.sigtcc.util.android;

import java.util.List;

import br.ufrn.sigtcc.controller.services.CentroServiceImpl;
import br.ufrn.sigtcc.controller.services.CursoServiceImpl;
import br.ufrn.sigtcc.controller.services.NoticiaServiceImpl;
import br.ufrn.sigtcc.controller.services.ProfessorServiceImpl;
import br.ufrn.sigtcc.model.entidades.Centro;
import br.ufrn.sigtcc.model.entidades.Curso;
import br.ufrn.sigtcc.model.entidades.Noticia;
import br.ufrn.sigtcc.model.entidades.Professor;
import br.ufrn.sigtcc.util.exceptions.BDException;


public class FacadeShowAndroid implements IFacadeShowAndroid{
	
	private static FacadeShowAndroid singleton = null; 

	private CentroServiceImpl centroService;
	private CursoServiceImpl cursoService;
	private ProfessorServiceImpl professorService;
	private NoticiaServiceImpl noticiaService;
	
	private FacadeShowAndroid(){
		centroService = new CentroServiceImpl();
		cursoService = new CursoServiceImpl();
		professorService = new ProfessorServiceImpl();
		noticiaService = new NoticiaServiceImpl();
		
	}

	public static FacadeShowAndroid getInstance(){
		
		if (singleton == null)
		{
			singleton = new FacadeShowAndroid();
		}		
		
		return singleton;
	}

	@Override
	public List<Curso> listarCursos() throws BDException {
		// TODO Auto-generated method stub
		return cursoService.listarTodosCursos();
	}

	@Override
	public List<Centro> listarCentros()throws BDException {
		// TODO Auto-generated method stub
		return centroService.listarTodosCentros();
	}

	@Override
	public List<Noticia> listarNoticias() throws BDException {
		// TODO Auto-generated method stub
		return noticiaService.listarNoticias();
	}

	@Override
	public List<Professor> listarProfessores() throws BDException {
		// TODO Auto-generated method stub
		return professorService.listarTodosProfessores();
	}	
    
  

}
